home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / wol < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.1 KB  |  48 lines

  1. # wol(1) completion
  2.  
  3. have wol &&
  4. _wol()
  5. {
  6.     local cur prev split=false
  7.     COMPREPLY=()
  8.     _get_comp_words_by_ref -n : cur prev
  9.     _split_longopt && split=true
  10.  
  11.     case $prev in
  12.         -V|--version|--help|-p|--port|--passwd|-w|--wait)
  13.             return 0
  14.             ;;
  15.         -h|--host|-i|--ipaddr)
  16.             # Broadcast addresses
  17.             COMPREPLY=( $( PATH=$PATH:/sbin ifconfig -a 2>/dev/null | \
  18.                 sed -ne 's/.*[[:space:]]\{1,\}Bcast:\([^[:space:]]*\).*/\1/p' \
  19.                     -e 's/.*[[:space:]]\{1,\}broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) )
  20.             _known_hosts_real "$cur"
  21.             return 0
  22.             ;;
  23.         -f|--file)
  24.             _filedir
  25.             return 0
  26.             ;;
  27.     esac
  28.  
  29.     $split && return 0
  30.  
  31.     if [[ "$cur" == -* ]]; then
  32.         COMPREPLY=( $( compgen -W '--help --version --verbose --wait --host
  33.             --port --file --passwd' -- "$cur" ) )
  34.         return 0
  35.     fi
  36.  
  37.     _mac_addresses
  38. } &&
  39. complete -F _wol wol
  40.  
  41. # Local variables:
  42. # mode: shell-script
  43. # sh-basic-offset: 4
  44. # sh-indent-comment: t
  45. # indent-tabs-mode: nil
  46. # End:
  47. # ex: ts=4 sw=4 et filetype=sh
  48.